/**
 * 第二周作业5
 * zlp
 */
//分析
//8-0,8
//8-1,8+1,7,9
//8-2,8+2,6,10
//8-3,8+3,5,11
//8-4,8+4,4,12
//8-5,8+5,3,13
//8-6,8+6,2,14
//8-7,8+7,1,15
var str = "A";
var height = 8;
for (let i = 0;i < height; i++){
  var result = "";
  var t = " ";//空格
  for(let j = 0;j<height+i;j++){
    if(i === height-1){//最后一行
      result += str;
    }else{
      if(j === height-1-i || j === height-1+i){
        result += str;
      }
      else{
        result += t;
      }
    }
  }
  console.log(result);
}
